﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CustomTempData.Controllers
{
    [HandleError]
    public class HomeController : CacheTempDataController
    {
        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";
            string fromTempData = TempData["ForTheFuture"] as string;
            if (fromTempData != null)
                ViewData["Message"] = fromTempData;

            return View();
        }

        public ActionResult About()
        {
            ViewData["Title"] = "About Page";
            TempData["ForTheFuture"] = "For The Future";
            return RedirectToAction("Index");
        }
    }
}
